package com.bdult.vh.dao;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class ItemDAO implements CommonDAO {
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;
	
	public ArrayList<HashMap<String,String>> getItemList(Map map) {
		//return (ArrayList<HashMap<String,String>>)sqlSessionTemplate.selectList("getItemList", map);
		return (ArrayList<HashMap<String,String>>)sqlSessionTemplate.selectList("getItemList_special", map);
	}
	
	public ArrayList<HashMap<String,String>> getItemList_best() {
		return (ArrayList<HashMap<String,String>>)sqlSessionTemplate.selectList("getItemList_best");
	}
	
	public ArrayList<HashMap<String,String>> getItemList_category(Map map) {
		return (ArrayList<HashMap<String,String>>)sqlSessionTemplate.selectList("getItemList_category", map);
	}
	
	public ArrayList<HashMap<String,String>> getItemList_keyword(Map map) {
		return (ArrayList<HashMap<String,String>>)sqlSessionTemplate.selectList("getItemList_keyword", map);
	}
	
	public ArrayList<HashMap<String,String>> getItemList_prdlist(Map map) {
		return (ArrayList<HashMap<String,String>>)sqlSessionTemplate.selectList("getItemList_prdlist", map);
	}
	
	public HashMap<String,String> getItemData(String prdcd) {
		return (HashMap<String,String>)sqlSessionTemplate.selectOne("getItemData", prdcd);
	}
	
	public ArrayList<HashMap<String,String>> getItemOption(String prdcd) {
		return (ArrayList<HashMap<String,String>>)sqlSessionTemplate.selectList("getItemOption", prdcd);
	}
}
